<template>
  <div class="box1">
    <p>{{ num }}</p>
  </div>
</template>

<script>
export default {
  name: 'A',
  data() {
    return {
      num: ''
    }
  },
  mounted() {
    this.$bus.$on('atob', (msg) => {
      this.num = msg
    })
  },
  beforeDestroy() {
    this.$bus.$off('atob')
  }
}
</script>

<style lang="scss" scoped>
.box1 {
  width: 200px;
  height: 200px;
  border: 20px solid greenyellow;
}
</style>
